package com.ryan.sbnote.model;

import com.ryan.sbnote.application.AppInfo;
import com.ryan.util.StringUtil;

public class UserModel {

	public static final String NICK="nick";
	public static final String NAME="name";
	public static final String PWD="pwd";
	public static final String TOKEN="token";
	
	private String nick;
	private String name;
	private String pwd;
	private String token;

	public static boolean isLogin(){
		UserModel user = AppInfo.getUser();
		if(user==null)
			return false;
		if(StringUtil.isEmpty(user.getNick()) && StringUtil.isEmpty(user.getToken()))
			return false;
		return true;
	}
	
	public static String getLoginUserNick(){
		if(isLogin()){
			UserModel user = AppInfo.getUser();
			return user.getNick();
		}
		return null;
	}
	
	public String getToken() {
		return token;
	}

	public void setToken(String token) {
		this.token = token;
	}

	public String getNick() {
		return nick;
	}

	public void setNick(String nick) {
		this.nick = nick;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getPwd() {
		return pwd;
	}

	public void setPwd(String pwd) {
		this.pwd = pwd;
	}

}
